﻿using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq.Expressions;
using System.Threading;
#if !WINDOWS_PHONE
using System.Threading.Tasks;
#endif

namespace System.Reactive.Linq
{
	public static partial class Qbservable
	{
		public static IQbservable<TSource> Finally<TSource>(this IQbservable<TSource> source, Expression<Action> finallyAction)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(finallyAction != null, null, "finallyAction != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> FirstAsync<TSource>(this IQbservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> FirstAsync<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, bool>> predicate)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(predicate != null, null, "predicate != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> FirstOrDefaultAsync<TSource>(this IQbservable<TSource> source)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TSource> FirstOrDefaultAsync<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, bool>> predicate)
		{
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(predicate != null, null, "predicate != null");
			Contract.Ensures(Contract.Result<IQbservable<TSource>>() != null, null, "Contract.Result<IQbservable<TSource>>() != null");
			return null;
		}

		public static IQbservable<TResult> For<TSource, TResult>(this IQbservableProvider provider, IEnumerable<TSource> source, Expression<Func<TSource, IObservable<TResult>>> resultSelector)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(source != null, null, "source != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IQbservable<TResult>>() != null, null, "Contract.Result<IQbservable<TResult>>() != null");
			return null;
		}

		public static IQbservable<TSource[]> ForkJoin<TSource>(this IQbservableProvider provider, IEnumerable<IObservable<TSource>> sources)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(sources != null, null, "sources != null");
			//Contract.Requires(Contract.ForAll(sources, observable => observable != null), null, "Contract.ForAll(sources, observable => observable != null)");
			Contract.Ensures(Contract.Result<IQbservable<TSource[]>>() != null, null, "Contract.Result<IQbservable<TSource[]>>() != null");
			return null;
		}

		public static IQbservable<TSource[]> ForkJoin<TSource>(this IQbservableProvider provider, params IObservable<TSource>[] sources)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(sources != null, null, "sources != null");
			//Contract.Requires(Contract.ForAll(sources, observable => observable != null), null, "Contract.ForAll(sources, observable => observable != null)");
			Contract.Ensures(Contract.Result<IQbservable<TSource[]>>() != null, null, "Contract.Result<IQbservable<TSource[]>>() != null");
			return null;
		}

		public static IQbservable<TResult> ForkJoin<TFirst, TSecond, TResult>(this IQbservable<TFirst> first, IObservable<TSecond> second, Expression<Func<TFirst, TSecond, TResult>> resultSelector)
		{
			Contract.Requires(first != null, null, "first != null");
			Contract.Requires(second != null, null, "second != null");
			Contract.Requires(resultSelector != null, null, "resultSelector != null");
			Contract.Ensures(Contract.Result<IQbservable<TResult>>() != null, null, "Contract.Result<IQbservable<TResult>>() != null");
			return null;
		}

#if !WINDOWS_PHONE
		public static IQbservable<TResult> FromAsync<TResult>(this IQbservableProvider provider, Expression<Func<Task<TResult>>> functionAsync)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(functionAsync != null, null, "functionAsync != null");
			Contract.Ensures(Contract.Result<IQbservable<TResult>>() != null, null, "Contract.Result<IQbservable<TResult>>() != null");
			return null;
		}

		public static IQbservable<Unit> FromAsync(this IQbservableProvider provider, Expression<Func<Task>> actionAsync)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(actionAsync != null, null, "actionAsync != null");
			Contract.Ensures(Contract.Result<IQbservable<Unit>>() != null, null, "Contract.Result<IQbservable<Unit>>() != null");
			return null;
		}

		public static IQbservable<TResult> FromAsync<TResult>(this IQbservableProvider provider, Expression<Func<CancellationToken, Task<TResult>>> functionAsync)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(functionAsync != null, null, "functionAsync != null");
			Contract.Ensures(Contract.Result<IQbservable<TResult>>() != null, null, "Contract.Result<IQbservable<TResult>>() != null");
			return null;
		}

		public static IQbservable<Unit> FromAsync(this IQbservableProvider provider, Expression<Func<CancellationToken, Task>> actionAsync)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(actionAsync != null, null, "actionAsync != null");
			Contract.Ensures(Contract.Result<IQbservable<Unit>>() != null, null, "Contract.Result<IQbservable<Unit>>() != null");
			return null;
		}
#endif

		public static Func<IQbservable<Unit>> FromAsyncPattern(this IQbservableProvider provider, Expression<Func<AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<IQbservable<Unit>>>() != null, null, "Contract.Result<Func<IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<IQbservable<TResult>> FromAsyncPattern<TResult>(this IQbservableProvider provider, Expression<Func<AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<IQbservable<TResult>>>() != null, null, "Contract.Result<Func<IQbservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, IQbservable<Unit>> FromAsyncPattern<T1>(this IQbservableProvider provider, Expression<Func<T1, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, IQbservable<TResult>> FromAsyncPattern<T1, TResult>(this IQbservableProvider provider, Expression<Func<T1, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, IQbservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, IQbservable<Unit>> FromAsyncPattern<T1, T2>(this IQbservableProvider provider, Expression<Func<T1, T2, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, IQbservable<TResult>> FromAsyncPattern<T1, T2, TResult>(this IQbservableProvider provider, Expression<Func<T1, T2, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, IQbservable<TResult>>>() != null");
			return null;
		}

#if !WINDOWS_PHONE
		public static Func<T1, T2, T3, IQbservable<Unit>> FromAsyncPattern<T1, T2, T3>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, IQbservable<TResult>> FromAsyncPattern<T1, T2, T3, TResult>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, IQbservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, IQbservable<Unit>> FromAsyncPattern<T1, T2, T3, T4>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, IQbservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, TResult>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, IQbservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, IQbservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, IQbservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, TResult>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, IQbservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, IQbservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, IQbservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, TResult>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, IQbservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, IQbservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, IQbservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, TResult>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, IQbservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, IQbservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, IQbservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, IQbservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IQbservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IQbservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, IQbservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IQbservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IQbservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, IQbservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, IQbservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, IQbservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, IQbservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, IQbservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, IQbservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, IQbservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, IQbservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, IQbservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, IQbservable<TResult>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, IQbservable<Unit>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, AsyncCallback, object, IAsyncResult>> begin, Expression<Action<IAsyncResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, IQbservable<Unit>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, IQbservable<Unit>>>() != null");
			return null;
		}

		public static Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, IQbservable<TResult>> FromAsyncPattern<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult>(this IQbservableProvider provider, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, AsyncCallback, object, IAsyncResult>> begin, Expression<Func<IAsyncResult, TResult>> end)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(begin != null, null, "begin != null");
			Contract.Requires(end != null, null, "end != null");
			Contract.Ensures(Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, IQbservable<TResult>>>() != null, null, "Contract.Result<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, IQbservable<TResult>>>() != null");
			return null;
		}
#endif

		public static IQbservable<TEventArgs> FromEvent<TEventArgs>(this IQbservableProvider provider, Expression<Action<Action<TEventArgs>>> addHandler, Expression<Action<Action<TEventArgs>>> removeHandler)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IQbservable<TEventArgs>>() != null, null, "Contract.Result<IQbservable<TEventArgs>>() != null");
			return null;
		}

		public static IQbservable<Unit> FromEvent(this IQbservableProvider provider, Expression<Action<Action>> addHandler, Expression<Action<Action>> removeHandler)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IQbservable<Unit>>() != null, null, "Contract.Result<IQbservable<Unit>>() != null");
			return null;
		}

		public static IQbservable<TEventArgs> FromEvent<TDelegate, TEventArgs>(this IQbservableProvider provider, Expression<Action<TDelegate>> addHandler, Expression<Action<TDelegate>> removeHandler)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IQbservable<TEventArgs>>() != null, null, "Contract.Result<IQbservable<TEventArgs>>() != null");
			return null;
		}

		public static IQbservable<TEventArgs> FromEvent<TDelegate, TEventArgs>(this IQbservableProvider provider, Expression<Func<Action<TEventArgs>, TDelegate>> conversion, Expression<Action<TDelegate>> addHandler, Expression<Action<TDelegate>> removeHandler)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(conversion != null, null, "conversion != null");
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IQbservable<TEventArgs>>() != null, null, "Contract.Result<IQbservable<TEventArgs>>() != null");
			return null;
		}

		public static IQbservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>(this IQbservableProvider provider, Expression<Action<EventHandler<TEventArgs>>> addHandler, Expression<Action<EventHandler<TEventArgs>>> removeHandler)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IQbservable<EventPattern<TEventArgs>>>() != null, null, "Contract.Result<IQbservable<EventPattern<TEventArgs>>>() != null");
			return null;
		}

		public static IQbservable<EventPattern<EventArgs>> FromEventPattern(this IQbservableProvider provider, Expression<Action<EventHandler>> addHandler, Expression<Action<EventHandler>> removeHandler)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IQbservable<EventPattern<EventArgs>>>() != null, null, "Contract.Result<IQbservable<EventPattern<EventArgs>>>() != null");
			return null;
		}

		public static IQbservable<EventPattern<TEventArgs>> FromEventPattern<TDelegate, TEventArgs>(this IQbservableProvider provider, Expression<Action<TDelegate>> addHandler, Expression<Action<TDelegate>> removeHandler)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IQbservable<EventPattern<TEventArgs>>>() != null, null, "Contract.Result<IQbservable<EventPattern<TEventArgs>>>() != null");
			return null;
		}

		public static IQbservable<EventPattern<TSender, TEventArgs>> FromEventPattern<TDelegate, TSender, TEventArgs>(this IQbservableProvider provider, Expression<Action<TDelegate>> addHandler, Expression<Action<TDelegate>> removeHandler)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IQbservable<EventPattern<TSender, TEventArgs>>>() != null, null, "Contract.Result<IQbservable<EventPattern<TSender, TEventArgs>>>() != null");
			return null;
		}

		public static IQbservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>(this IQbservableProvider provider, object target, string eventName)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(target != null, null, "target != null");
			Contract.Requires(eventName != null, null, "eventName != null");
			Contract.Ensures(Contract.Result<IQbservable<EventPattern<TEventArgs>>>() != null, null, "Contract.Result<IQbservable<EventPattern<TEventArgs>>>() != null");
			return null;
		}

		public static IQbservable<EventPattern<EventArgs>> FromEventPattern(this IQbservableProvider provider, object target, string eventName)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(target != null, null, "target != null");
			Contract.Requires(eventName != null, null, "eventName != null");
			Contract.Ensures(Contract.Result<IQbservable<EventPattern<EventArgs>>>() != null, null, "Contract.Result<IQbservable<EventPattern<EventArgs>>>() != null");
			return null;
		}

		public static IQbservable<EventPattern<TSender, TEventArgs>> FromEventPattern<TSender, TEventArgs>(this IQbservableProvider provider, object target, string eventName)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(target != null, null, "target != null");
			Contract.Requires(eventName != null, null, "eventName != null");
			Contract.Ensures(Contract.Result<IQbservable<EventPattern<TSender, TEventArgs>>>() != null, null, "Contract.Result<IQbservable<EventPattern<TSender, TEventArgs>>>() != null");
			return null;
		}

		public static IQbservable<EventPattern<EventArgs>> FromEventPattern(this IQbservableProvider provider, Type type, string eventName)
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(type != null, null, "type != null");
			Contract.Requires(eventName != null, null, "eventName != null");
			Contract.Ensures(Contract.Result<IQbservable<EventPattern<EventArgs>>>() != null, null, "Contract.Result<IQbservable<EventPattern<EventArgs>>>() != null");
			return null;
		}

		public static IQbservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>(this IQbservableProvider provider, Type type, string eventName)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(type != null, null, "type != null");
			Contract.Requires(eventName != null, null, "eventName != null");
			Contract.Ensures(Contract.Result<IQbservable<EventPattern<TEventArgs>>>() != null, null, "Contract.Result<IQbservable<EventPattern<TEventArgs>>>() != null");
			return null;
		}

		public static IQbservable<EventPattern<TSender, TEventArgs>> FromEventPattern<TSender, TEventArgs>(this IQbservableProvider provider, Type type, string eventName)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(type != null, null, "type != null");
			Contract.Requires(eventName != null, null, "eventName != null");
			Contract.Ensures(Contract.Result<IQbservable<EventPattern<TSender, TEventArgs>>>() != null, null, "Contract.Result<IQbservable<EventPattern<TSender, TEventArgs>>>() != null");
			return null;
		}

		public static IQbservable<EventPattern<TEventArgs>> FromEventPattern<TDelegate, TEventArgs>(this IQbservableProvider provider, Expression<Func<EventHandler<TEventArgs>, TDelegate>> conversion, Expression<Action<TDelegate>> addHandler, Expression<Action<TDelegate>> removeHandler)
#if SILVERLIGHT
 where TEventArgs : EventArgs
#endif
		{
			Contract.Requires(provider != null, null, "provider != null");
			Contract.Requires(conversion != null, null, "conversion != null");
			Contract.Requires(addHandler != null, null, "addHandler != null");
			Contract.Requires(removeHandler != null, null, "removeHandler != null");
			Contract.Ensures(Contract.Result<IQbservable<EventPattern<TEventArgs>>>() != null, null, "Contract.Result<IQbservable<EventPattern<TEventArgs>>>() != null");
			return null;
		}
	}
}